home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15205 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: mail2news.demon.co.uk!txwang
  2. From: Wang TianXing <gztxwang@public1.guangzhou.gd.cn>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Fastest Sorting Algorithm?
  5. Date: Thu, 04 Apr 1996 04:50:01 GMT
  6. Message-ID: <199604040451.MAA05683@public1.guangzhou.gd.cn>
  7. X-NNTP-Posting-Host: txwang
  8. X-Newsreader: Forte Free Agent 1.0.82
  9. X-Mail2News-Path: public1.guangzhou.gd.cn!txwang
  10.  
  11. On Wed, 3 Apr 1996 19:51:18 GMT, sckettle@undergrad.math.uwaterloo.ca
  12. (Steve Kettle) wrote:
  13.  
  14. | In article <Dou55w.7MB@novice.uwaterloo.ca>,
  15. | Gerald Wang  <GTWANG@HELIX.Watstar.UWaterloo.CA> wrote:
  16. | >A classmate was recently asked during a job interview what is the fastest 
  17. | >method to sort an array of numbers. He replied "Use a quicksort." They 
  18. | >asked "And how would you make it faster still?" He couldn't come up with 
  19. | >much...end of interview.
  20. | >
  21. | >I know it's a vague question... Any ideas on what they were asking? Or 
  22. | >what the right answer is?
  23. | >
  24. | >Gerald
  25. | >
  26. | >-------------------------------------------------------------------------
  27. | >Gerald Wang
  28. | >http://www.csclub.uwaterloo.ca/~gtwang
  29. | >
  30. | >
  31.  
  32. | Well you could use a type of bucket sorting algorithm which is faster than
  33. | quicksort when sorting integers.  How to make it faster I don't know - you
  34. | don't really make algortithms faster you make code implementations of
  35. | algorithms faster. Mybe they meant tweaking stratigies for quicksort like how
  36. | to choose a pivot element.  Who knows. 
  37.  
  38. | -- 
  39.  
  40. The right "answer" is to ask them what they are going to sort.
  41.  
  42. When you were confronted with such kind of "the best", "the fastest",
  43. "the whatever'est" questions, always ask the questioner what s/he
  44. really wants to do.
  45.  
  46. ---
  47. Wang TianXing
  48.  
  49.  
  50.